import React, {Component} from 'react';
import Message from "./Message";
import News from "./News";
import MyNavLink from "../../components/MyNavLink";
import {Route,Switch,Redirect} from "react-router-dom";

class Home extends Component {
    render() {
        return (
            <div className="col-xs-6">
                <div className="panel">
                    <div className="panel-body">
                        <h3>我是Home的内容</h3>
                    </div>
                    <ul className="nav nav-tabs">
                        <li>
                            <MyNavLink to="/home/news" className="list-group-item">News</MyNavLink>
                        </li>
                        <li>
                            <MyNavLink to="/home/message" className="list-group-item">Message</MyNavLink>
                        </li>
                    </ul>
                    <Switch>
                        <Route path="/home/news" component={News}></Route>
                        <Route path="/home/message" component={Message}></Route>
                        <Redirect  to="/home/news" ></Redirect>
                    </Switch>
                </div>
            </div>
        );
    }
}

export default Home;